package org.tgcloud.group.web.controller.app;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;
import org.tgcloud.group.core.APPResultMessage;
import org.tgcloud.group.core.session.Session;
import org.tgcloud.group.service.app.FileService;
import org.tgcloud.group.web.controller.req.file.FileOrderIdReq;

/**
 * @author: zhy
 * @create: 2023-08-25 11:06
 * @description: 文件相关接口
 */
@Api(tags = "文件相关接口")
@RestController
@RequestMapping("/app/user")
@EnableAutoConfiguration
public class FileController extends ClientAPPBaseController{

    @Autowired
    private FileService fileService;


    @ApiOperation(value = "下载表单")
    @ApiImplicitParams({
    })
    @ResponseBody
    @PostMapping(value = "/doDownloadFile")
    public APPResultMessage doDownloadFile(@ModelAttribute("session") Session session,
                                           @RequestBody FileOrderIdReq req) throws Exception{
        return fileService.doDownloadFile(session.getUserId(), session.getUserType(), req);
    }

}
